<template>
  <div>
    <el-form :model="form" size="small" inline>
      <el-form-item label="code">
        <el-input v-model="form.code" placeholder="" />
      </el-form-item>
      <el-form-item label="时间">
        <el-date-picker v-model="form.startDate" value-format="yyyy-MM-dd" placeholder="" />
        <el-date-picker v-model="form.endDate" value-format="yyyy-MM-dd" placeholder="" />
      </el-form-item>
      <el-form-item label="">
        <el-button type="primary" size="small" @click="getSharesPrice">查询</el-button>
      </el-form-item>
    </el-form>
    <el-table :data="list" cell-class-name="tableColumn" size="small" height="500px">
      <el-table-column label="code" prop="code" align="center" />
      <el-table-column label="名称" prop="name" align="center" />
      <el-table-column label="行业" prop="industry" align="center" />
      <el-table-column label="日期" prop="date" align="center" />
      <el-table-column label="开盘价" prop="open_price" align="center" />
    </el-table>
  </div>
</template>

<script>
import { getSharesPrice } from '@/api/base'
export default {
  data() {
    return {
      form: {
        code: ''
      },
      list: []
    }
  },
  mounted() {
    const code = this.$route.query.code ?? ''
    this.form.code = code
    this.getSharesPrice()
  },
  methods: {
    async getSharesPrice() {
      const { list } = await getSharesPrice(this.form)
      // console.log(res)
      this.list = list
    }
  }
}
</script>

<style>

</style>
